<%@ Register TagPrefix="CA" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>
<%@ Register TagPrefix="CP" Namespace="CommunityServer.ControlPanel.Controls" Assembly="CommunityServer.Web" %>
<%@ Page language="c#" Codebehind="Email.aspx.cs" AutoEventWireup="false" Inherits="CommunityServer.ControlPanel.Settings.EmailSettings" %>
<cp:controlpanelselectednavigation selectednavitem="CommonTasks" runat="server" id="SelectedNavigation1" />
<cs:mpcontainer runat="server" id="MPContainer" thememasterfile="SetupControlPanelMaster.ascx">
	<cs:mpcontent id="DescriptionRegion" runat="server">
		<cp:resourcecontrol id="RegionTitle" runat="Server" resourcename="CP_Settings_Email_Title"></cp:resourcecontrol>
	</cs:mpcontent>
	<cs:mpcontent id="TaskRegion" runat="Server">
		<CP:statusmessage id="Status" runat="server"></CP:statusmessage>
		<DIV class="CommonDescription"></DIV>
		<div class="FixedWidthContainer">
		<DIV class="CommonGroupedContentArea">
			<H3 class="CommonSubTitle">
				<cp:resourcecontrol id="Resourcecontrol27" runat="server" resourcename="CP_Settings_Email_SubTitle_General"></cp:resourcecontrol></H3>
			<TABLE cellSpacing="0" cellPadding="2" border="0">
				<TR>
					<TD class="CommonFormFieldName">
						<cp:helpicon id="Helpicon13" runat="Server" resourcename="CP_Settings_Email_Enable_Descr"></cp:helpicon>
						<cp:resourcecontrol id="ResourceControl136" runat="server" resourcename="CP_Settings_Email_Enable"></cp:resourcecontrol></TD>
					<TD class="CommonFormField" noWrap>
						<cs:yesnoradiobuttonlist id="EnableEmail" runat="server" repeatcolumns="2" cssclass="ControlPanelTextInput"></cs:yesnoradiobuttonlist></TD>
				</TR>
				<TR id="EnableMailGateway_Row" runat="server">
					<TD class="CommonFormFieldName">
						<cp:helpicon id="Helpicon14" runat="Server" resourcename="CP_Settings_Email_EnableMG_Descr"></cp:helpicon>
						<cp:resourcecontrol id="ResourceControl5" runat="server" resourcename="CP_Settings_Email_EnableMG"></cp:resourcecontrol></TD>
					<TD class="CommonFormField" noWrap>
						<cs:yesnoradiobuttonlist id="EnableMailGateway" runat="server" repeatcolumns="2" cssclass="ControlPanelTextInput" onclick="DisableFields();"></cs:yesnoradiobuttonlist></TD>
				</TR>
				<TR>
					<TD class="CommonFormFieldName">
						<cp:helpicon id="Helpicon8" runat="Server" resourcename="CP_Settings_Email_Encoding_Descr"></cp:helpicon>
						<cp:resourcecontrol id="Resourcecontrol4" runat="server" resourcename="CP_Settings_Email_Encoding" name="ResourceControl138"></cp:resourcecontrol></TD>
					<TD class="CommonFormField">
						<asp:textbox id="EmailEncoding" runat="server" maxlength="64"></asp:textbox></TD>
				</TR>
				<TR id="EmailThrottle_Row">
					<TD class="CommonFormFieldName">
						<cp:helpicon id="Helpicon5" runat="Server" resourcename="CP_Settings_Email_EmailThrottle_Descr"></cp:helpicon>
						<cp:resourcecontrol id="lblEmailThrottle" runat="server" resourcename="CP_Settings_Email_EmailThrottle"></cp:resourcecontrol></TD>
					<TD class="CommonFormField">
						<asp:textbox id="EmailThrottle" runat="server" maxlength="5"></asp:textbox>
						<asp:requiredfieldvalidator id="EmailThrottleValidator" runat="server" controltovalidate="EmailThrottle" font-bold="True"
							errormessage="*"></asp:requiredfieldvalidator></TD>
				</TR>
				<TR id="SmtpServer_Row">
					<TD class="CommonFormFieldName">
						<cp:helpicon id="Helpicon1" runat="Server" resourcename="CP_Settings_Email_Server_Descr"></cp:helpicon>
						<cp:resourcecontrol id="ResourceControl138" runat="server" resourcename="CP_Settings_Email_Server" name="ResourceControl138"></cp:resourcecontrol></TD>
					<TD class="CommonFormField">
						<asp:textbox id="SmtpServer" runat="server" maxlength="64"></asp:textbox></TD>
				</TR>
			</TABLE>
		</DIV>
		    <div id="SMTP_Login_Info_Area">
			<H3 class="CommonSubTitle">
				<cp:resourcecontrol id="Resourcecontrol1" runat="server" resourcename="CP_Settings_Email_SubTitle_SMTP"></cp:resourcecontrol></H3>
			<TABLE cellSpacing="0" cellPadding="2" border="0">
				<TR>
					<TD class="CommonFormFieldName">
						<cp:helpicon id="Helpicon7" runat="Server" resourcename="CP_Settings_Email_UsingNtlm_Descr"></cp:helpicon>
						<cp:resourcecontrol id="Resourcecontrol3" runat="server" resourcename="CP_Settings_Email_UsingNtlm"></cp:resourcecontrol></TD>
					<TD class="CommonFormField">
						<cs:yesnoradiobuttonlist id="SmtpServerUsingNtlm" runat="server" repeatcolumns="2" cssclass="ControlPanelTextInput"></cs:yesnoradiobuttonlist></TD>
				</TR>
				<TR>
					<TD class="CommonFormFieldName">
						<cp:helpicon id="Helpicon2" runat="Server" resourcename="CP_Settings_Email_NeedsLogin_Descr"></cp:helpicon>
						<cp:resourcecontrol id="ResourceControl140" runat="server" resourcename="CP_Settings_Email_NeedsLogin"></cp:resourcecontrol></TD>
					<TD class="CommonFormField">
						<cs:yesnoradiobuttonlist id="SmtpServerRequiredLogin" runat="server" repeatcolumns="2" cssclass="ControlPanelTextInput"></cs:yesnoradiobuttonlist></TD>
				</TR>
				<TR>
					<TD class="CommonFormFieldName">
						<cp:helpicon id="Helpicon3" runat="Server" resourcename="CP_Settings_Email_UserName_Descr"></cp:helpicon>
						<cp:resourcecontrol id="ResourceControl142" runat="server" resourcename="CP_Settings_Email_UserName"></cp:resourcecontrol></TD>
					<TD class="CommonFormField">
						<asp:textbox id="SmtpServerUserName" runat="server" maxlength="64"></asp:textbox>
						<asp:requiredfieldvalidator id="SmtpServerUserNameValidator" runat="server" controltovalidate="SmtpServerUserName"
							font-bold="True" errormessage="*"></asp:requiredfieldvalidator></TD>
				</TR>
				<TR>
					<TD class="CommonFormFieldName">
						<cp:helpicon id="Helpicon4" runat="Server" resourcename="CP_Settings_Email_Password_Descr"></cp:helpicon>
						<cp:resourcecontrol id="ResourceControl144" runat="server" resourcename="CP_Settings_Email_Password"></cp:resourcecontrol></TD>
					<TD class="CommonFormField">
						<asp:textbox id="SmtpServerPassword" runat="server" maxlength="64"></asp:textbox>
						<asp:requiredfieldvalidator id="SmtpServerPasswordValidator" runat="server" controltovalidate="SmtpServerPassword"
							font-bold="True" errormessage="*"></asp:requiredfieldvalidator></TD>
				</TR>
				<TR>
					<TD class="CommonFormFieldName">
						<cp:helpicon id="Helpicon6" runat="Server" resourcename="CP_Settings_Email_PortNumber_Descr"></cp:helpicon>
						<cp:resourcecontrol id="Resourcecontrol2" runat="server" resourcename="CP_Settings_Email_PortNumber"></cp:resourcecontrol></TD>
					<TD class="CommonFormField">
						<asp:textbox id="SmtpPortNumber" runat="server" maxlength="10"></asp:textbox></TD>
				</TR>
			</TABLE>
			</div>
		</div>
		<p class="PanelSaveButton DetailsFixedWidth">
			<cp:resourcelinkbutton id="SaveButton" runat="server" resourcename="Save" cssclass="CommonTextButton"></cp:resourcelinkbutton></p>

        <script language="javascript">
        <!--
        function DisableFields()
        {
            var enableMailGateway = document.getElementsByName('<%=EnableMailGateway.ClientID.Replace("_", "$") %>');

            if(enableMailGateway.length > 0)
            {
                var yesButton = enableMailGateway[0];
                if(yesButton.checked)
                {
                    HideOrShowControl(document.getElementById('<%=EmailThrottle.ClientID %>'), false);
                    HideOrShowControl(document.getElementById('<%=SmtpServer.ClientID %>'), false);
                    HideOrShowControl(document.getElementById('<%=SmtpServerUsingNtlm.ClientID %>'), false);
                    HideOrShowControl(document.getElementById('<%=SmtpServerRequiredLogin.ClientID %>'), false);
                    HideOrShowControl(document.getElementById('<%=SmtpServerUserName.ClientID %>'), false);
                    HideOrShowControl(document.getElementById('<%=SmtpServerPassword.ClientID %>'), false);
                    HideOrShowControl(document.getElementById('<%=SmtpPortNumber.ClientID %>'), false);
                }
                else
                {
                    HideOrShowControl(document.getElementById('<%=EmailThrottle.ClientID %>'), true);
                    HideOrShowControl(document.getElementById('<%=SmtpServer.ClientID %>'), true);
                    HideOrShowControl(document.getElementById('<%=SmtpServerUsingNtlm.ClientID %>'), true);
                    HideOrShowControl(document.getElementById('<%=SmtpServerRequiredLogin.ClientID %>'), true);
                    HideOrShowControl(document.getElementById('<%=SmtpServerUserName.ClientID %>'), true);
                    HideOrShowControl(document.getElementById('<%=SmtpServerPassword.ClientID %>'), true);
                    HideOrShowControl(document.getElementById('<%=SmtpPortNumber.ClientID %>'), true);
                }
            }
        }
        
        function HideOrShowControl(control, visible)
        {
            if(visible)
                control.disabled = false;
            else
                control.disabled = true;
        }
        
        function EnableForSubmit()
        {
            HideOrShowControl(document.getElementById('<%=EmailThrottle.ClientID %>'), true);
            HideOrShowControl(document.getElementById('<%=SmtpServer.ClientID %>'), true);
            HideOrShowControl(document.getElementById('<%=SmtpServerUsingNtlm.ClientID %>'), true);
            HideOrShowControl(document.getElementById('<%=SmtpServerRequiredLogin.ClientID %>'), true);
            HideOrShowControl(document.getElementById('<%=SmtpServerUserName.ClientID %>'), true);
            HideOrShowControl(document.getElementById('<%=SmtpServerPassword.ClientID %>'), true);
            HideOrShowControl(document.getElementById('<%=SmtpPortNumber.ClientID %>'), true);
        }

        DisableFields();
        // --> 
        </script>

	</cs:mpcontent>
</cs:mpcontainer>